home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / QD3DCamera.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  14.0 KB  |  464 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        QD3DCamera.a
  3. ;
  4. ;    Contains:    Generic camera routines                                             
  5. ;
  6. ;    Version:    Technology:    Quickdraw 3D 1.5.4
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__QD3DCAMERA__') = 'UNDEFINED' THEN
  18. __QD3DCAMERA__ SET 1
  19.  
  20.     IF &TYPE('__QD3D__') = 'UNDEFINED' THEN
  21.     include 'QD3D.a'
  22.     ENDIF
  23.  
  24. ; ******************************************************************************
  25. ; **                                                                             **
  26. ; **                            Data Structure Definitions                         **
  27. ; **                                                                             **
  28. ; ****************************************************************************
  29.  
  30. ; *  The placement of the camera.
  31.  
  32. TQ3CameraPlacement        RECORD 0
  33. cameraLocation             ds        TQ3Point3D        ; offset: $0 (0)        ;   Location point of the camera     
  34. pointOfInterest             ds        TQ3Point3D        ; offset: $C (12)        ;   Point of interest                 
  35. upVector                 ds        TQ3Vector3D        ; offset: $18 (24)        ;   "up" vector                     
  36. sizeof                     EQU *                    ; size:   $24 (36)
  37.                         ENDR
  38. ; *  The range of the camera.
  39.  
  40. TQ3CameraRange            RECORD 0
  41. hither                     ds        Float32            ; offset: $0 (0)        ;   Hither plane, measured from "from" towards "to"    
  42. yon                         ds        Float32            ; offset: $4 (4)        ;   Yon  plane, measured from "from" towards "to"     
  43. sizeof                     EQU *                    ; size:   $8 (8)
  44.                         ENDR
  45. ; *  Viewport specification.  Origin is (-1, 1), and corresponds to the 
  46. ; *  upper left-hand corner; width and height maximum is (2.0, 2.0),
  47. ; *  corresponding to the lower left-hand corner of the window.  The
  48. ; *  TQ3Viewport specifies a part of the viewPlane that gets displayed 
  49. ; *    on the window that is to be drawn.
  50. ; *  Normally, it is set with an origin of (-1.0, 1.0), and a width and
  51. ; *  height of both 2.0, specifying that the entire window is to be
  52. ; *  drawn.  If, for example, an exposure event of the window exposed
  53. ; *  the right half of the window, you would set the origin to (0, 1),
  54. ; *  and the width and height to (1.0) and (2.0), respectively.
  55. ; *
  56.  
  57. TQ3CameraViewPort        RECORD 0
  58. origin                     ds        TQ3Point2D        ; offset: $0 (0)
  59. width                     ds        Float32            ; offset: $8 (8)
  60. height                     ds        Float32            ; offset: $C (12)
  61. sizeof                     EQU *                    ; size:   $10 (16)
  62.                         ENDR
  63. TQ3CameraData            RECORD 0
  64. placement                 ds        TQ3CameraPlacement ; offset: $0 (0)
  65. range                     ds        TQ3CameraRange ; offset: $24 (36)
  66. viewPort                 ds        TQ3CameraViewPort ; offset: $2C (44)
  67. sizeof                     EQU *                    ; size:   $3C (60)
  68.                         ENDR
  69. ; *  An orthographic camera.
  70. ; *
  71. ; *  The lens characteristics are set with the dimensions of a
  72. ; *  rectangular viewPort in the frame of the camera.
  73.  
  74. TQ3OrthographicCameraData RECORD 0
  75. cameraData                 ds        TQ3CameraData    ; offset: $0 (0)
  76. left                     ds        Float32            ; offset: $3C (60)
  77. top                         ds        Float32            ; offset: $40 (64)
  78. right                     ds        Float32            ; offset: $44 (68)
  79. bottom                     ds        Float32            ; offset: $48 (72)
  80. sizeof                     EQU *                    ; size:   $4C (76)
  81.                         ENDR
  82. ; *  A perspective camera specified in terms of an arbitrary view plane.
  83. ; *
  84. ; *  This is most useful when setting the camera to look at a particular
  85. ; *  object.  The viewPlane is set to distance from the camera to the object.
  86. ; *  The halfWidth is set to half the width of the cross section of the object,
  87. ; *  and the halfHeight equal to the halfWidth divided by the aspect ratio
  88. ; *  of the viewPort.
  89. ; * 
  90. ; *  This is the only perspective camera with specifications for off-axis
  91. ; *  viewing, which is desirable for scrolling.
  92.  
  93. TQ3ViewPlaneCameraData    RECORD 0
  94. cameraData                 ds        TQ3CameraData    ; offset: $0 (0)
  95. viewPlane                 ds        Float32            ; offset: $3C (60)
  96. halfWidthAtViewPlane     ds        Float32            ; offset: $40 (64)
  97. halfHeightAtViewPlane     ds        Float32            ; offset: $44 (68)
  98. centerXOnViewPlane         ds        Float32            ; offset: $48 (72)
  99. centerYOnViewPlane         ds        Float32            ; offset: $4C (76)
  100. sizeof                     EQU *                    ; size:   $50 (80)
  101.                         ENDR
  102. ; *    A view angle aspect camera is a perspective camera specified in 
  103. ; *    terms of the minimum view angle and the aspect ratio of X to Y.
  104. ; *
  105.  
  106. TQ3ViewAngleAspectCameraData RECORD 0
  107. cameraData                 ds        TQ3CameraData    ; offset: $0 (0)
  108. fov                         ds        Float32            ; offset: $3C (60)
  109. aspectRatioXToY             ds        Float32            ; offset: $40 (64)
  110. sizeof                     EQU *                    ; size:   $44 (68)
  111.                         ENDR
  112. ; ******************************************************************************
  113. ; **                                                                             **
  114. ; **                            Generic Camera routines                             **
  115. ; **                                                                             **
  116. ; ****************************************************************************
  117.  
  118.  
  119. ;
  120. ; extern TQ3ObjectType Q3Camera_GetType(TQ3CameraObject camera)
  121. ;
  122.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  123.         IMPORT_CFM_FUNCTION Q3Camera_GetType
  124.     ENDIF
  125.  
  126. ;
  127. ; extern TQ3Status Q3Camera_SetData(TQ3CameraObject camera, const TQ3CameraData *cameraData)
  128. ;
  129.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  130.         IMPORT_CFM_FUNCTION Q3Camera_SetData
  131.     ENDIF
  132.  
  133. ;
  134. ; extern TQ3Status Q3Camera_GetData(TQ3CameraObject camera, TQ3CameraData *cameraData)
  135. ;
  136.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  137.         IMPORT_CFM_FUNCTION Q3Camera_GetData
  138.     ENDIF
  139.  
  140. ;
  141. ; extern TQ3Status Q3Camera_SetPlacement(TQ3CameraObject camera, const TQ3CameraPlacement *placement)
  142. ;
  143.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  144.         IMPORT_CFM_FUNCTION Q3Camera_SetPlacement
  145.     ENDIF
  146.  
  147. ;
  148. ; extern TQ3Status Q3Camera_GetPlacement(TQ3CameraObject camera, TQ3CameraPlacement *placement)
  149. ;
  150.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  151.         IMPORT_CFM_FUNCTION Q3Camera_GetPlacement
  152.     ENDIF
  153.  
  154. ;
  155. ; extern TQ3Status Q3Camera_SetRange(TQ3CameraObject camera, const TQ3CameraRange *range)
  156. ;
  157.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  158.         IMPORT_CFM_FUNCTION Q3Camera_SetRange
  159.     ENDIF
  160.  
  161. ;
  162. ; extern TQ3Status Q3Camera_GetRange(TQ3CameraObject camera, TQ3CameraRange *range)
  163. ;
  164.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  165.         IMPORT_CFM_FUNCTION Q3Camera_GetRange
  166.     ENDIF
  167.  
  168. ;
  169. ; extern TQ3Status Q3Camera_SetViewPort(TQ3CameraObject camera, const TQ3CameraViewPort *viewPort)
  170. ;
  171.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  172.         IMPORT_CFM_FUNCTION Q3Camera_SetViewPort
  173.     ENDIF
  174.  
  175. ;
  176. ; extern TQ3Status Q3Camera_GetViewPort(TQ3CameraObject camera, TQ3CameraViewPort *viewPort)
  177. ;
  178.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  179.         IMPORT_CFM_FUNCTION Q3Camera_GetViewPort
  180.     ENDIF
  181.  
  182. ;
  183. ; extern TQ3Status Q3Camera_GetWorldToView(TQ3CameraObject camera, TQ3Matrix4x4 *worldToView)
  184. ;
  185.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  186.         IMPORT_CFM_FUNCTION Q3Camera_GetWorldToView
  187.     ENDIF
  188.  
  189. ;
  190. ; extern TQ3Status Q3Camera_GetWorldToFrustum(TQ3CameraObject camera, TQ3Matrix4x4 *worldToFrustum)
  191. ;
  192.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  193.         IMPORT_CFM_FUNCTION Q3Camera_GetWorldToFrustum
  194.     ENDIF
  195.  
  196. ;
  197. ; extern TQ3Status Q3Camera_GetViewToFrustum(TQ3CameraObject camera, TQ3Matrix4x4 *viewToFrustum)
  198. ;
  199.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  200.         IMPORT_CFM_FUNCTION Q3Camera_GetViewToFrustum
  201.     ENDIF
  202.  
  203.  
  204. ; ******************************************************************************
  205. ; **                                                                             **
  206. ; **                            Specific Camera Routines                          **
  207. ; **                                                                             **
  208. ; ****************************************************************************
  209.  
  210. ; ******************************************************************************
  211. ; **                                                                             **
  212. ; **                            Orthographic Camera                                  **
  213. ; **                                                                             **
  214. ; ****************************************************************************
  215.  
  216. ;
  217. ; extern TQ3CameraObject Q3OrthographicCamera_New(const TQ3OrthographicCameraData *orthographicData)
  218. ;
  219.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  220.         IMPORT_CFM_FUNCTION Q3OrthographicCamera_New
  221.     ENDIF
  222.  
  223. ;
  224. ; extern TQ3Status Q3OrthographicCamera_GetData(TQ3CameraObject camera, TQ3OrthographicCameraData *cameraData)
  225. ;
  226.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  227.         IMPORT_CFM_FUNCTION Q3OrthographicCamera_GetData
  228.     ENDIF
  229.  
  230. ;
  231. ; extern TQ3Status Q3OrthographicCamera_SetData(TQ3CameraObject camera, const TQ3OrthographicCameraData *cameraData)
  232. ;
  233.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  234.         IMPORT_CFM_FUNCTION Q3OrthographicCamera_SetData
  235.     ENDIF
  236.  
  237. ;
  238. ; extern TQ3Status Q3OrthographicCamera_SetLeft(TQ3CameraObject camera, float left)
  239. ;
  240.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  241.         IMPORT_CFM_FUNCTION Q3OrthographicCamera_SetLeft
  242.     ENDIF
  243.  
  244. ;
  245. ; extern TQ3Status Q3OrthographicCamera_GetLeft(TQ3CameraObject camera, float *left)
  246. ;
  247.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  248.         IMPORT_CFM_FUNCTION Q3OrthographicCamera_GetLeft
  249.     ENDIF
  250.  
  251. ;
  252. ; extern TQ3Status Q3OrthographicCamera_SetTop(TQ3CameraObject camera, float top)
  253. ;
  254.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  255.         IMPORT_CFM_FUNCTION Q3OrthographicCamera_SetTop
  256.     ENDIF
  257.  
  258. ;
  259. ; extern TQ3Status Q3OrthographicCamera_GetTop(TQ3CameraObject camera, float *top)
  260. ;
  261.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  262.         IMPORT_CFM_FUNCTION Q3OrthographicCamera_GetTop
  263.     ENDIF
  264.  
  265. ;
  266. ; extern TQ3Status Q3OrthographicCamera_SetRight(TQ3CameraObject camera, float right)
  267. ;
  268.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  269.         IMPORT_CFM_FUNCTION Q3OrthographicCamera_SetRight
  270.     ENDIF
  271.  
  272. ;
  273. ; extern TQ3Status Q3OrthographicCamera_GetRight(TQ3CameraObject camera, float *right)
  274. ;
  275.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  276.         IMPORT_CFM_FUNCTION Q3OrthographicCamera_GetRight
  277.     ENDIF
  278.  
  279. ;
  280. ; extern TQ3Status Q3OrthographicCamera_SetBottom(TQ3CameraObject camera, float bottom)
  281. ;
  282.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  283.         IMPORT_CFM_FUNCTION Q3OrthographicCamera_SetBottom
  284.     ENDIF
  285.  
  286. ;
  287. ; extern TQ3Status Q3OrthographicCamera_GetBottom(TQ3CameraObject camera, float *bottom)
  288. ;
  289.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  290.         IMPORT_CFM_FUNCTION Q3OrthographicCamera_GetBottom
  291.     ENDIF
  292.  
  293.  
  294. ; ******************************************************************************
  295. ; **                                                                             **
  296. ; **                            ViewPlane Camera                                  **
  297. ; **                                                                             **
  298. ; ****************************************************************************
  299.  
  300. ;
  301. ; extern TQ3CameraObject Q3ViewPlaneCamera_New(const TQ3ViewPlaneCameraData *cameraData)
  302. ;
  303.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  304.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_New
  305.     ENDIF
  306.  
  307. ;
  308. ; extern TQ3Status Q3ViewPlaneCamera_GetData(TQ3CameraObject camera, TQ3ViewPlaneCameraData *cameraData)
  309. ;
  310.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  311.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_GetData
  312.     ENDIF
  313.  
  314. ;
  315. ; extern TQ3Status Q3ViewPlaneCamera_SetData(TQ3CameraObject camera, const TQ3ViewPlaneCameraData *cameraData)
  316. ;
  317.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  318.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_SetData
  319.     ENDIF
  320.  
  321. ;
  322. ; extern TQ3Status Q3ViewPlaneCamera_SetViewPlane(TQ3CameraObject camera, float viewPlane)
  323. ;
  324.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  325.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_SetViewPlane
  326.     ENDIF
  327.  
  328. ;
  329. ; extern TQ3Status Q3ViewPlaneCamera_GetViewPlane(TQ3CameraObject camera, float *viewPlane)
  330. ;
  331.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  332.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_GetViewPlane
  333.     ENDIF
  334.  
  335. ;
  336. ; extern TQ3Status Q3ViewPlaneCamera_SetHalfWidth(TQ3CameraObject camera, float halfWidthAtViewPlane)
  337. ;
  338.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  339.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_SetHalfWidth
  340.     ENDIF
  341.  
  342. ;
  343. ; extern TQ3Status Q3ViewPlaneCamera_GetHalfWidth(TQ3CameraObject camera, float *halfWidthAtViewPlane)
  344. ;
  345.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  346.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_GetHalfWidth
  347.     ENDIF
  348.  
  349. ;
  350. ; extern TQ3Status Q3ViewPlaneCamera_SetHalfHeight(TQ3CameraObject camera, float halfHeightAtViewPlane)
  351. ;
  352.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  353.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_SetHalfHeight
  354.     ENDIF
  355.  
  356. ;
  357. ; extern TQ3Status Q3ViewPlaneCamera_GetHalfHeight(TQ3CameraObject camera, float *halfHeightAtViewPlane)
  358. ;
  359.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  360.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_GetHalfHeight
  361.     ENDIF
  362.  
  363. ;
  364. ; extern TQ3Status Q3ViewPlaneCamera_SetCenterX(TQ3CameraObject camera, float centerXOnViewPlane)
  365. ;
  366.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  367.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_SetCenterX
  368.     ENDIF
  369.  
  370. ;
  371. ; extern TQ3Status Q3ViewPlaneCamera_GetCenterX(TQ3CameraObject camera, float *centerXOnViewPlane)
  372. ;
  373.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  374.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_GetCenterX
  375.     ENDIF
  376.  
  377. ;
  378. ; extern TQ3Status Q3ViewPlaneCamera_SetCenterY(TQ3CameraObject camera, float centerYOnViewPlane)
  379. ;
  380.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  381.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_SetCenterY
  382.     ENDIF
  383.  
  384. ;
  385. ; extern TQ3Status Q3ViewPlaneCamera_GetCenterY(TQ3CameraObject camera, float *centerYOnViewPlane)
  386. ;
  387.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  388.         IMPORT_CFM_FUNCTION Q3ViewPlaneCamera_GetCenterY
  389.     ENDIF
  390.  
  391.  
  392. ; ******************************************************************************
  393. ; **                                                                             **
  394. ; **                            View Angle Aspect Camera                          **
  395. ; **                                                                             **
  396. ; ****************************************************************************
  397.  
  398. ;
  399. ; extern TQ3CameraObject Q3ViewAngleAspectCamera_New(const TQ3ViewAngleAspectCameraData *cameraData)
  400. ;
  401.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  402.         IMPORT_CFM_FUNCTION Q3ViewAngleAspectCamera_New
  403.     ENDIF
  404.  
  405. ;
  406. ; extern TQ3Status Q3ViewAngleAspectCamera_SetData(TQ3CameraObject camera, const TQ3ViewAngleAspectCameraData *cameraData)
  407. ;
  408.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  409.         IMPORT_CFM_FUNCTION Q3ViewAngleAspectCamera_SetData
  410.     ENDIF
  411.  
  412. ;
  413. ; extern TQ3Status Q3ViewAngleAspectCamera_GetData(TQ3CameraObject camera, TQ3ViewAngleAspectCameraData *cameraData)
  414. ;
  415.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  416.         IMPORT_CFM_FUNCTION Q3ViewAngleAspectCamera_GetData
  417.     ENDIF
  418.  
  419. ;
  420. ; extern TQ3Status Q3ViewAngleAspectCamera_SetFOV(TQ3CameraObject camera, float fov)
  421. ;
  422.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  423.         IMPORT_CFM_FUNCTION Q3ViewAngleAspectCamera_SetFOV
  424.     ENDIF
  425.  
  426. ;
  427. ; extern TQ3Status Q3ViewAngleAspectCamera_GetFOV(TQ3CameraObject camera, float *fov)
  428. ;
  429.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  430.         IMPORT_CFM_FUNCTION Q3ViewAngleAspectCamera_GetFOV
  431.     ENDIF
  432.  
  433. ;
  434. ; extern TQ3Status Q3ViewAngleAspectCamera_SetAspectRatio(TQ3CameraObject camera, float aspectRatioXToY)
  435. ;
  436.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  437.         IMPORT_CFM_FUNCTION Q3ViewAngleAspectCamera_SetAspectRatio
  438.     ENDIF
  439.  
  440. ;
  441. ; extern TQ3Status Q3ViewAngleAspectCamera_GetAspectRatio(TQ3CameraObject camera, float *aspectRatioXToY)
  442. ;
  443.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  444.         IMPORT_CFM_FUNCTION Q3ViewAngleAspectCamera_GetAspectRatio
  445.     ENDIF
  446.  
  447.  
  448.  
  449.  
  450.     ENDIF ; __QD3DCAMERA__ 
  451.  
  452.